package ua.kpi.javatraning5.dgrishchenko.module1;

import org.junit.Test;
import static org.junit.Assert.*;

public class PolyndromTest {

	@Test(expected = IllegalArgumentException.class)
	public void testCheckArgumentsOnNull() {
		String[] nullArray = {};
		Polyndrom.checkArguments(nullArray);
	}

	@Test
	public void testFind() {
		Polyndrom.polyndromArray = new String[2];
		Polyndrom.find("adada");
		assertEquals("adada", Polyndrom.polyndromArray[0]);
		assertEquals("dad", Polyndrom.polyndromArray[1]);

	}

	@Test
	public void testDelleteSpaces() {
		String wordWithoutSpace = Polyndrom.delleteSpaces("A D A A A Ddd D");
		assertArrayEquals("ADAAADddD", wordWithoutSpace);
	}

	private boolean assertArrayEquals(String string, String wordWithoutSpace) {
		if (!string.equals(wordWithoutSpace)) {

		}
		return true;
	}

}
